/*
 * Scope.java
 *
 * Copyright©2012 JMAS corporation. All rights reserved.
 */
package jp.co.jmas.jmasvideo.jaxb;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
public class Scope {
	/** type:UserById */
	public static final String USER_BY_ID = "UserById";

	/** type:UserByEmail */
	public static final String USER_BY_EMAIL = "UserByEmail";

	@XmlAttribute(name = "type", required = true)
	private String type;

	@XmlElement(name = "EmailAddress")
	private String email;

	@XmlElement(name = "ID")
	private String id;

	@XmlElement(name = "Name")
	private String name;

	public String getType() {
		return type;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		if (email != null) {
			type = USER_BY_EMAIL;
		}
		this.email = email;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		if (id != null) {
			type = USER_BY_ID;
		}
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
